﻿@{
    Layout = null;
}

<div class="panel-body" style="padding:0">
    <div class="panel panel-default">
        <div class="panel-heading"></div>
        <div class="panel-body">
            <form id="formSearch" class="form-horizontal">
                <div class="form-group">
                    @if(string.IsNullOrEmpty(ViewBag.MerchantId))
                    {
                        <p style="color:red;font-size:20px;margin-left:30px;">该商户还未配置店铺信息，不允许操作收款方式，请您首先配置商户信息</p>
                    }
                </div>
                <div class="form-group">
                    <label class="control-label" for="name_search">收款方式</label>
                    <div class="col-sm-3">
                        <select class="form-control" id="method_search" name="method_search">
                            <option value="-1">全部</option>
                            <option value="银行卡">银行卡</option>
                            <option value="微信">微信</option>
                            <option value="支付宝">支付宝</option>
                        </select>
                    </div>
                    <div class="col-sm-3">
                        <button type="button" id="btnQueryList" class="btn btn-primary"><i class="fa fa-search"></i>查询</button>
                        <button type="button" id="btnReset" class="btn btn-primary"><i class="fa fa-remove"></i>清空</button>
                    </div>
                </div>
            </form>
            <hr />
            <div>
                <table id="receivablesinfo"></table>
            </div>
        </div>
    </div>
</div>

<div id="toolbar" class="btn-group">
    <button id="btnAddDialog" type="button" class="btn btn-primary"><span><i class="fa fa-plug"></i>&nbsp;添加</span></button>
    <button id="btnEditDialog" type="button" class="btn btn-primary"><span><i class="fa fa-edit"></i>&nbsp;修改</span></button>
    <button id="btnYesSetDefaultDialog" type="button" class="btn btn-primary"><span><i class="fa fa-book"></i>设置默认</span></button>
    <button id="btnNoSetDefaultDialog" type="button" class="btn btn-primary"><span><i class="fa fa-book"></i>取消默认</span></button>
    <button id="btnDelDialog" type="button" class="btn btn-primary"><span><i class="fa fa-remove"></i>&nbsp;删除</span></button> 
</div>

@*添加修改收款方式*@
<div class="modal fade" id="AddEditModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title" id="HeadTitle">添加收款方式</h4>
            </div>
            <div class="modal-body">
                <form id="AddEditOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="Id" name="Id" />
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">店铺名称:</span>
                            <input type="text" value="@ViewBag.MerchantName" class="form-control" readonly="readonly" />
                        </div>
                    </div>
                    <div class="form-group">     
                         <div class="input-group">
                            <span class="input-group-addon">收款方式:</span>
                            <select class="form-control" id="Method" name="Method">
                                <option value="银行卡">银行卡</option>
                                <option value="微信">微信</option>
                                <option value="支付宝">支付宝</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">开户行:</span>
                            <input type="text" id="OpeningBank" name="OpeningBank" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">开户名:</span>
                            <input type="text" id="OpeningName" name="OpeningName" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">开户帐号:</span>
                            <input type="text" id="OpeningAccount" name="OpeningAccount" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">三方帐号:</span>
                            <input type="text" id="ThirdAccount" name="ThirdAccount" class="form-control" />
                        </div>
                    </div>                 
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnAddEditOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

@*设置默认和非默认收款方式*@
<div class="modal fade" id="SetDefaultMarkModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title">开户行：(<span id="DefaultMark_Head_Title">***</span>)设置默认/非默认页面</h4>
            </div>
            <div class="modal-body">
                <form id="SetDefaultMarkOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="defaultmark_id" name="defaultmark_id" />
                    <div class="form-group">
                        <div class="input-group">
                            您确认要设置开户行<span id="DefaultMark_Head_Title_OK">***</span>吗？
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnSetDefaultOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

@*删除收款方式*@
<div class="modal fade" id="DelModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">开户行：(<span id="Delete_Head_Title">***</span>)删除确认页面</h4>
            </div>
            <div class="modal-body">
                <form id="DelOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="delete_id" name="delete_id" />
                    <div class="form-group">
                        <div class="input-group">
                            您确认要删除开户行（<span id="Delete_Head_Title_OK">***</span>)吗？
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnDeleteOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

<script src="~/Scripts/project/min/receivables.min.js"></script>
<script type="text/javascript">
    $(function () {
        ml.admin.receivables.init({
            "MerchantId": "@ViewBag.MerchantId"
        });
    });
</script>